package com.bqtt.tumor.demo.entity;

import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.bqtt.tumor.demo.common.utility.InlineTools;


@Entity
@Table(name="occupation_def")
public class Occupation  implements IDBEntity{

	@Id 
    @Column(name="occupation_def_id")    
    @GeneratedValue(strategy=GenerationType.IDENTITY) 
	private Integer occupation_def_id;
	
	@Column(name="occupation_name")
	private String occupation_name;

	
	@Column(name="occupation_category")
	private String occupation_category;

	
	@Transient
	private String displayName;
	
	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}
	
	
	public Occupation() {
		super();
		displayName="none";
		// TODO Auto-generated constructor stub
	}

	public Integer getOccupation_def_id() {
		return occupation_def_id;
	}

	public void setOccupation_def_id(Integer occupation_def_id) {
		this.occupation_def_id = occupation_def_id;
	}

	public String getOccupation_name() {
		return occupation_name;
	}

	public void setOccupation_name(String occupation_name) {
		this.occupation_name = occupation_name;
	}

	public String getOccupation_category() {
		return occupation_category;
	}

	public void setOccupation_category(String occupation_category) {
		this.occupation_category = occupation_category;
	}

	
	
	public Occupation(Integer occupation_def_id, String occupation_name,
			long occupation_code, String occupation_category) {
		super();
		this.occupation_def_id = occupation_def_id;
		this.occupation_name = occupation_name;
		this.occupation_category = occupation_category;
		displayName ="none";
	}

	@Override
	public Map<String, Object> getSQLValidAttributes() {
		// TODO Auto-generated method stub
		Map<String,Object> result = new HashMap<String,Object>();
		
		if(!InlineTools.isEmpty(occupation_name))
		{
			result.put("occupation_name", occupation_name);
		}
		
		return result;
	}

	@Override
	public void fillStringField() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void fillDBfields() {
		// TODO Auto-generated method stub
		
	}

	
	
	 
}
